﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Meiam.System.Common
{
    public class OAPushHelper
    {
        public static async Task Push(string code,string title,string linkUrl,string linkMobileUrl,string workcodelist,string context)
        {
            try
            {
             //   string adminUserInfo = string.IsNullOrEmpty(AdminUser) ? "" : ("," + AdminUser);
                //推送消息组合
                PushEntity pubEntity = new PushEntity();
                pubEntity.code = code;
                pubEntity.context = context;
                pubEntity.creater = "";
                pubEntity.linkMobileUrl = linkMobileUrl;
                pubEntity.linkUrl = linkUrl;
                pubEntity.title = title;
                pubEntity.workCodeList = workcodelist;
                var postdata = JsonConvert.SerializeObject(pubEntity);
                var s = HTTPHelpers.Post("http://172.16.0.24:7777/stage-api/mes/pushMsg", postdata);

            }
            catch (Exception ex)
            {
            }
        }
    }

    public class PushEntity
    {
        public string code { set; get; }
        public string context { set; get; }
        public string creater { set; get; }
        public string linkMobileUrl { set; get; }
        public string linkUrl { set; get; }
        public string title { set; get; }
        public string workCodeList { set; get; }
    }
}
